package com.gollum.web.controller;

import com.gollum.common.utils.MessageUtils;
import com.gollum.mq.MqSender;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 首页模块
 * @author Herther
 */
@Api(tags = "首页模块")
@RestController
public class IndexController {

    @Autowired
    protected MqSender mqSender;
    @ApiImplicitParam(name = "name",value = "姓名",required = true)
    @ApiOperation(value = "向客人问好")
    @GetMapping("/sayHi")
    public ResponseEntity<String> sayHi(@RequestParam(value = "name")String name){
        mqSender.send("streamKey", name);
        return ResponseEntity.ok("Hi:"+name +"TEST,I18N" + MessageUtils.getMsg("file.upload_the_abnormal"));
    }
}